<%@ page pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!--下面这个用于美化时间，下面表格中时间那里多了一个fmt就能看出来-->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        收费项目管理
    </title>
   <!--
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <!--<script type="text/javascript" src="lib/loading/okLoading.js"></script>-->
    <script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/x-layui.js" charset="utf-8"></script>
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>收费项目管理</cite></a>
              <a><cite>收费项目列表</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form x-center" action="${pageContext.request.contextPath}/chargeproject/listUi" method="post" style="width:800px" enctype="multipart/form-data">
        <div class="layui-form-pane" style="margin-top: 15px;">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="pname"  placeholder="收费项目名称" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline" style="width:80px">
                    <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                </div>
            </div>
        </div>
    </form>
    <xblock>
        <button class="layui-btn"  onclick="pro_add('收费项目添加','${pageContext.request.contextPath}/chargeproject/addUi','1000','600')">
            <i class="layui-icon">&#xe608;</i>添加
        </button>
        <!--下方的$处表示chargeproject中一共有多少个数据-->
        <span class="x-right" style="line-height:40px">共有数据：<span class="layui-badge">${pageInfo.size}</span> 条</span></xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>收费项目编号</th>
            <th>所属小区</th>
            <th>收费服务号</th>
            <th>收费项目名称</th>
            <th>收费项目创建时间</th>
            <th>证据</th>
            <th>收费员</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <!--这里开始载入动态数据，item处表示数据源,var处表示临时变量，varStatus表示状态码-->
        <c:forEach items="${pageInfo.list}" var="chargeprojectVo" varStatus="status">
        <tr>
            <td> ${status.index + 1}</td>
            <td>${chargeprojectVo.vname}</td>
            <td >${chargeprojectVo.pservicecode}</td>
            <td >${chargeprojectVo.pname}</td>
            <td >
                <fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${chargeprojectVo.createTime}"/>
            </td>
            <td>
                <img src="${pageContext.request.contextPath}/images/${chargeprojectVo.evidence}" width="40px">
            </td>
            <td>${chargeprojectVo.tname}</td>
            <td class="td-manage">
                <a title="编辑" href="javascript:;" onclick="edit('编辑','${pageContext.request.contextPath}/chargeproject/editUi','${chargeprojectVo.id}','1000','600')"
                   class="ml-5" style="text-decoration:none">
                    <i class="layui-icon">&#xe642;</i>
                </a>
                <a title="删除" href="${pageContext.request.contextPath}/chargeproject/delete?id=${chargeprojectVo.id}"
                   style="text-decoration:none">
                    <i class="layui-icon">&#xe640;</i>
                </a>
            </td>
        </tr>
        </c:forEach>
        </tbody>
    </table>


    <!--分页-->
    <div id="page">
        <ul class="pagination">
            <li <c:if test="${pageInfo.pageNum == 1}">class="disabled"</c:if>>
                <a href="${pageContext.request.contextPath}/chargeproject/listUi?pageNum=1&name=${chargeproject.pname}">首页</a>
            </li>

            <li >
                <c:if test="${pageInfo.pageNum == 1}">
                    <a class="disabled">上一页</a>
                </c:if>
                <c:if test="${pageInfo.pageNum != 1}">
                    <a href="${pageContext.request.contextPath}/chargeproject/listUi?pageNum=${pageInfo.pageNum-1}&name=${chargeproject.pname}">上一页</a>
                </c:if>
            </li>

            <c:forEach begin="1" end="${pageInfo.pages}" var="index">
                <li <c:if test="${index == pageInfo.pageNum}">class="active"</c:if>>
                    <a href="${pageContext.request.contextPath}/chargeproject/listUi?pageNum=${index}&name=${chargeproject.pname}">${index}</a>
                </li>
            </c:forEach>

            <li >
                <c:if test="${pageInfo.pageNum == pageInfo.pages}">
                    <a class="disabled">下一页</a>
                </c:if>
                <c:if test="${pageInfo.pageNum != pageInfo.pages}">
                    <a href="${pageContext.request.contextPath}/chargeproject/listUi?pageNum=${pageInfo.pageNum+1}&name=${chargeproject.pname}">下一页</a>
                </c:if>
            </li>

            <li <c:if test="${pageInfo.pageNum == pageInfo.pages}">class="disabled"</c:if>>
                <a href="${pageContext.request.contextPath}/chargeproject/listUi?pageNum=${pageInfo.pages}&name=${chargeproject.pname}" >尾页</a>
            </li>
        </ul>

    </div>
</div>

<script>
    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层
        //以上模块根据需要引入
    });

    //批量删除提交
    function delAll () {
        layer.confirm('确认要删除吗？',function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
        });
    }


    /*添加*/
    function pro_add(title,url,w,h){
        x_admin_show(title,url,w,h);
    }
    //编辑
    function edit (title,url,id,w,h) {
        url = url+"?id="+id;
        x_admin_show(title,url,w,h);
    }

    /*删除*/
    function pro_del(obj,id){
        alert("删除数据")
    }
</script>

</body>
</html>